package cn.task.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import cn.task.mapper.TaskapplicationMapper;
import cn.task.po.Taskapplication;
import cn.task.po.TaskapplicationExample;
import cn.task.po.TaskapplicationExample.Criteria;
import cn.task.service.TaskapplicationService;

public class TaskapplicationServiceImpl implements TaskapplicationService {
	@Autowired
	private TaskapplicationMapper taskapplicationMapper;
	@Override
	public void insertTaskapplicat(Taskapplication taskapplication) {
		taskapplicationMapper.insert(taskapplication);
	}

	@Override
	public List<Taskapplication> selectTaskapplicat(String taskId) {
		TaskapplicationExample example=new TaskapplicationExample();
		Criteria  criteria =example.createCriteria();
		criteria.andTaskidEqualTo(taskId);
		return taskapplicationMapper.selectByExample(example);
	}

	@Override
	public void updateTaskapplication(Taskapplication taskapplication) {
		taskapplicationMapper.updateByPrimaryKey(taskapplication);
	}

	@Override
	public int countTaskapplication(String taskId) {
		TaskapplicationExample example=new TaskapplicationExample();
		Criteria  criteria =example.createCriteria();
		criteria.andTaskidEqualTo(taskId);
		return  taskapplicationMapper.countByExample(example);
	}

}
